import request from '@/utils/request'
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

/**
 * 新增子部门
 *
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
/**
 * 获取指定部门信息
 *
 * 参数名：id
 */
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
/**
 * 获取指定部门信息
 *put
 * 参数名：id
 */
export function updateDepartmentDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
/**
 * 获取指定部门信息
 *delete
 * 参数名：id
 */
export function deleteDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete',
    data: { id }
  })
}
